

LIBNAME=myfile
INSTPATH=`pwd`/../lib/
CFLAGS+=-I${INSTPATH}

CC=gcc
AR=ar

all:dynamic_lib
	@make install
	@make clear

dynamic_lib:
	${CC} -shared -fPIC *.c -o lib${LIBNAME}.so ${CFLAGS}

install:
	cp -rf lib${LIBNAME}.* ${INSTPATH}

clear:
	rm -f *.o

clean:clear
	rm -f lib${LIBNAME}.*
